.client-container {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main {
    width: 1000px;
    height: 740px;
    background-color: rgb(238, 238, 238);
    border-radius: 5px;

    display: flex;

    z-index: 2;
}

.main .left {
    width: 280px;
    height: 100%;
    background-color: rgb(46, 50, 56);
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

.main .right {
    width: 720px;
    height: 100%;

    padding: 0 20px;
}

.cover {
    width: 100%;
    height: 100%;

    background-image: url(../img/bgi.jpg);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;

    /* 为了让 .cover 和 .main 重叠, 可以给 .cover 加上个定位属性 */
    position: absolute;
    top: 0;
    left: 0;

    /* 设置了 z 轴坐标 */
    z-index: 1;

    /* 使用 css 滤镜效果, 使背景图实现朦胧效果 */
    filter: blur(30px);
}

.main .left .user {
    height: 80px;
    font-size: 20px;
    line-height: 80px;
    color: white;
    padding: 0 20px;
}

.main .left .search {
    height: 40px;
    padding: 0 20px;

    display: flex;
    justify-content: center;
    align-items: center;
}

.main .left .search input {
    height: 34px;
    width: 200px;
    line-height: 34px;
    font-size: 14px;
    color: white;

    background-color: rgb(38, 41, 46);
    /* 去除边框和轮廓线 */
    border: none;
    outline: none;

    padding-left: 10px;
    border-radius: 5px;
}

.main .left .search button {
    height: 34px;
    width: 34px;
    border: none;
    outline: none;

    background-color: rgb(38, 41, 46);
    border-radius: 5px;
    background-image: url(../img/搜索.png);
    background-repeat: no-repeat;
    background-size: 20px 20px;
    background-position: center center;
}

.main .left .search button:active {
    background-color: gray;
}

.main .left .tab {
    height: 50px;
    display: flex;
    align-items: center;
}

.main .left .tab .tab-session {
    height: 100%;
    width: 50%;

    background-image: url(../img/对话1.png);
    background-repeat: no-repeat;
    background-size: 30px 30px;
    background-position: center center;

}

.main .left .tab .tab-friend {
    height: 100%;
    width: 50%;

    background-image: url(../img/用户2.png);
    background-repeat: no-repeat;
    background-size: 30px 30px;
    background-position: center center;
}

.main .left .tab .tab-add-friend {
    height: 100%;
    width: 50%;

    background-image: url(../img/搜索.png);
    background-repeat: no-repeat;
    background-size: 30px 30px;
    background-position: center center;
}

.main .left .tab .tab-friend-req {
    height: 100%;
    width: 50%;

    background-image: url(../img/添加用户2.png);
    background-repeat: no-repeat;
    background-size: 30px 30px;
    background-position: center center;
}


.main .left .list {
    height: 570px;

    /* 滚动条 */
    overflow: auto;
}

.main .left .list li {
    /*height: 60px;*/
    padding: 10px 20px;
    color: white;
    border-top: 1px solid black;
}

.main .left .list .selected {
    background-color: rgb(46, 54, 65);
}

/* 会话列表 */
.main .left .list li h3,
.main .left .list li p {
    /*height: 20px;*/
    font-size: 14px;
    line-height: 20px;
}

/* 好友列表 */
.main .left .list li h4 {
    height: 40px;
    line-height: 40px;
    font-size: 20px;
}

/* 添加好友 */
#add-friend li {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#add-friend button {
    padding: 10px 20px;
    background-color: #258821;
    color: #fff;
    border: none;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#add-friend button:hover {
    background-color: #165608;
}

#add-friend button:focus {
    outline: none;
}

/* 点击添加好友弹出的模拟框 */
/* 省略前面的样式，仅添加模态框相关样式 */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    width: 400px;
    height: 300px;
    max-width: 90%; /* 限制最大宽度，避免过大 */
    border-radius: 4px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* 居中显示 */
}

.modal-content h3,
.modal-content p {
    text-align: center;
}

#reasonInput {
    width: 350px;
    height: 170px;
    resize: none;
    font-size: 25px;
}

.close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
}

.modal-buttons {
    display: flex;
    justify-content: center; /* 水平居中 */
    margin-top: 20px;
}

.modal-buttons button {
    margin: 0 10px; /* 按钮之间的间距 */
    transition: background-color 0.3s ease, color 0.3s ease; /* 添加过渡效果 */
}

#addFriendBtn {
    width: 100px;
    height: 35px;
    background-color: #368c24; /* 添加按钮的背景颜色 */
    color: #fff; /* 添加按钮的文字颜色 */
    border-radius: 5px;
    border: none;
}

#cancelBtn {
    width: 100px;
    height: 35px;
    background-color: #e74c3c; /* 关闭按钮的背景颜色 */
    color: #fff; /* 关闭按钮的文字颜色 */
    border-radius: 5px;
    border: none;
}

#addFriendBtn:hover,
#cancelBtn:hover {
    background-color: #2e4757; /* 悬停时的背景颜色 */
}



#friend-req {
    list-style: none;
    padding: 0;
}

.friend-req-item {
    border: 1px solid #536136;
    padding: 10px;
    margin-bottom: 10px;
}

.friend-req-item .name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}


.friend-req-item .message {
    font-size: 14px;
    color: #e5e9ea;
    margin-bottom: 10px;
    word-wrap: break-word; /* 或者使用 word-break: break-word; */
    max-height: 200px; /* 设置消息容器的最大高度 */
    overflow-y: auto; /* 如果消息内容超过最大高度，添加垂直滚动条 */
}

.friend-req-item .buttons {
    display: flex;
    justify-content: space-between;
}

.friend-req-item .accept-btn,
.friend-req-item .reject-btn {
    width: 100px;
    padding: 8px;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
}

.friend-req-item .accept-btn {
    background-color: #217c24;
}

.friend-req-item .reject-btn {
    background-color: #912f27;
}








/* 应用这个 css 这个元素就会被自动隐藏 */
.hide {
    display: none;
}

/* 隐藏滚动条 */
::-webkit-scrollbar {
    display: none;
}

.main .right .title {
    height: 50px;
    line-height: 50px;
    font-size: 20px;
    text-align: center;
    border-bottom: 1px solid #ccc;
}

.main .right .message-show {
    height: 550px;

    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;

    /* 内容太多, 自动进行滚动 */
    overflow: auto;
}

.main .right .message-show .message {
    margin-top: 10px;
    /* 宽度默认 100%, 高度的话不显式设定, 后续一条消息的内容有多有少 */
    display: flex;
}

/* 这个样式让子元素靠左 */
.main .right .message-show .message-left {
    justify-content: flex-start;
}

/* 这个样式让子元素靠右 */
.main .right .message-show .message-right {
    justify-content: flex-end;
}

.main .right .message-show .message .box {
    /* box 凸显出左右这样的效果, 宽度不能是 100% */
    width: 500px;
}

.main .right .message-show .message .box h4 {
    /* 去掉加粗效果 */
    font-weight: normal;
    height: 20px;
    line-height: 20px;
    font-size: 16px;
}

.main .right .message-show .message .box p {
    padding: 20px;
    border-radius: 10px;
}

/* 给消息设置背景色(气泡) */
.main .right .message-show .message-left .box p {
    background-color: #fff;
}

.main .right .message-show .message-right .box p {
    background-color: rgb(146, 243, 119);
}

.main .right .message-input {
    display: block;

    width: 100%;
    height: 100px;
    border: none;
    outline: none;

    margin-top: 2px;
    background-color: rgb(238, 238, 238);
    padding: 10px;
    resize: none;
}

.main .right .ctrl {
    height: 35px;
    display: flex;
    justify-content: end;
}

.main .right .ctrl button {
    height: 35px;
    width: 100px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.main .right .ctrl button:active {
    background-color: grey;
    color: white;
}